package com.example.springboot.mapper;

import com.example.springboot.pojo.Dishinfo;
import org.apache.ibatis.annotations.*;

import java.util.List;
//mapper层负责数据访问

@Mapper
public interface DishinfoMapper {
    @Select("select * from dishinfo")
    List<Dishinfo> list();
    @Select("select * from dishinfo where id = #{id}")
    Dishinfo  selectById(Integer id);
    @Insert("insert into dishinfo(name,category,price) values (#{name},#{category},#{price})")
    void insert(Dishinfo host);
    @Update("update dishinfo set name = #{name}, category= #{category}, price = #{price} where id = #{id}")
    void update(Dishinfo dishinfo);

    void delete(List<Integer> ids);
}

